<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IsArchive</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../styles/styles.css">
<script language="javascript" src='../../links.js' type="text/javascript"></script>
</head>

<body>

<h1>IsArchive</h1>
<div class=navbar>
<a href="../../index.html">main</a> |
<a href="../index.html">Custom API</a> |
<a href="index.html">archive support</a><br>
</div>

<div class=shortdescr>
Check whether the specified file is an archive.
</div>

<pre class=syntax>
BOOL WINAPI IsArchive(
  const char *Name,
  const unsigned char *Data,
  int DataSize
);
</pre>
<h3>Parameters</h3>
<div class=descr>

    <div class=dfn>Name</div>
    <div class=dfndescr>Archive name</div>
    <div class=dfn>Data</div>
    <div class=dfndescr>
archive file data (pointer to data of DataSize size relative to the beginning of the file)
    </div>
    <div class=dfn>DataSize</div>
    <div class=dfndescr>
the size of data passed to the function
    </div>

</div>

<h3>Return value</h3>
<div class=descr>
  <p>
TRUE if the archive type is supported by plugin.
  </p>
</div>

<h3>Example</h3>
<div class=descr>
  <p>
An example of ZIP archive definition (ZIP.CPP)
  </p>
<pre class=code>BOOL WINAPI _export IsArchive(const char *Name,
                      const unsigned char *Data,
                      int DataSize)
{
  for (int I=0;I &lt; DataSize-10;I++)
  {
    const unsigned char *D=Data+I;
    if (D[0]=='P' &amp;&amp; D[1]=='K' &amp;&amp;
        D[2]==3   &amp;&amp; D[3]==4   &amp;&amp;
        D[8]&lt;15   &amp;&amp; D[9]==0)
    {
      SFXSize=I;
      return(TRUE);
    }
  }
  return(FALSE);
}
</pre>
</div>

<div class=see>See also:</div><div class=seecont>
<a href="index.html">archive support</a>
</div>
</body>
</html>
